package com.franklin.ideaplugin.maphelper.col.operation.impl.collection.list;

import com.franklin.ideaplugin.maphelper.col.method.IColInsertMethod;
import com.franklin.ideaplugin.maphelper.col.method.IColQueryMethod;
import com.franklin.ideaplugin.maphelper.col.method.impl.ColInsertMethodImpl;
import com.franklin.ideaplugin.maphelper.col.method.impl.DefaultColQueryMethod;
import com.franklin.ideaplugin.maphelper.col.operation.impl.collection.CollectionReadWriteOperation;

import java.util.List;
import java.util.Set;

/**
 * List操作
 *
 * @author Ye Junhui
 * @since 2024/3/11
 */
public class ListReadWriteOperation extends CollectionReadWriteOperation {



    @Override
    public String getClassQualifiedName() {
        return List.class.getName();
    }

    @Override
    public Set<IColInsertMethod> getInsertMethods() {
        Set<IColInsertMethod> insertMethods = super.getInsertMethods();
        insertMethods.add(new ColInsertMethodImpl("add", 1, 0));
        insertMethods.add(new ColInsertMethodImpl("set", 2, 1));
        insertMethods.add(new ColInsertMethodImpl("add", 2, 1));
        return insertMethods;
    }

    @Override
    public Set<IColInsertMethod> getInsertAllMethods() {
        Set<IColInsertMethod> insertAllMethods = super.getInsertAllMethods();
        insertAllMethods.add(new ColInsertMethodImpl("addAll", 1, 0));
        insertAllMethods.add(new ColInsertMethodImpl("addAll", 2, 1));
        return insertAllMethods;
    }

    @Override
    public Set<IColQueryMethod> getQueryMethods() {
        Set<IColQueryMethod> queryMethods = super.getQueryMethods();
        queryMethods.add(new DefaultColQueryMethod("get", 1, 0));
        queryMethods.add(new DefaultColQueryMethod("remove", 1, 0));
        return queryMethods;
    }
}
